package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface BrandMapper extends Mapper<Brand> {

    @Select("SELECT tb_b. NAME,tb_b.image FROM tb_category tb_c JOIN tb_category_brand tb_c_b ON tb_c.id = tb_c_b.category_id " +
            "JOIN tb_brand tb_b ON tb_c_b.brand_id = tb_b.id WHERE tb_c. NAME = #{categoryName} " +
            "ORDER BY tb_b.seq")
    public List<Map> findBrandListByCategoryName(@Param("categoryName") String categoryName);

}
